
public class Car {
	private double price;
	boolean isSportCar;
	private String model;
	String color;
	private int maxSpeed;
	String brand;
	int currentGear;
	double coef=0.2;
	Person owner;
	private final int MAX_SPEED = 200;
	private final String CHEAP_COLOR1="black";
	private final String CHEAP_COLOR2="white";
//	boolean isMoreExpensive;
	void setModel(String newModel){
		if(model!=null && !model.equals(""))
		model=newModel;
	}
	
	String getModel(){
		
		return model;
	}
	
	void setMaxSpeed(int newMaxSpeed){
		if(newMaxSpeed>0)
		maxSpeed=newMaxSpeed;
	}
	int getMaxSpeed(){
		return maxSpeed;
	}
	
	void setPrice(double newPrice){
		if(newPrice>0)
		price=newPrice;
	}
	
	double getPrice(){
		return price;
	}
	
	
	Car(){
		currentGear=3;
		brand="Audi";
	}
	
	
	Car(String model, boolean isSportCar, String color, double price, int maxSpeed){
		this ();
		if(maxSpeed<MAX_SPEED){
			isSportCar=false;
		}
		this.model=model;
		this.isSportCar=isSportCar;
		this.color=color;
		this.price=price;
		this.maxSpeed=maxSpeed;
	}
	public boolean isMoreExpensive(Car car1){
		if (this.price>car1.price)
		return true;
		else
			return false;
	}
	double calculateCarPriceForScrap(double metalPrice){
		if(color.equals(CHEAP_COLOR1) || color.equals(CHEAP_COLOR2)){
			coef+=0.02;
		}
		if(isSportCar=true){
			coef+=0.05;
		}
		return coef*metalPrice;
		
		
	}

//	double currentSpeed;

//	Person owner;
//	Car(){
//		maxSpeed = 250;
////		color = "gray";
//		maxSpeed = 250;
//		currentSpeed =0 ;
//		currentGear = 0;
//		brand="VW";
////		Person premium = new Person();
////		premium.name="Premium Car";
////		owner = premium;
//	}
//	Car(String usedColor, Person buyer){
//		maxSpeed = 250;
//		maxSpeed = 250;
//		color = usedColor;
//		owner= buyer;
//	}

}
